using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.VoteQuestions;
using Entity.StoreProcedure;
using BussinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_VoteQuestions
    {
        public static DataTable SelectAll(int status)
        {
            try
            {
                BOVoteQuestions_Select_All action = new BOVoteQuestions_Select_All();
                usp_VoteQuestions_Select_All entity = new usp_VoteQuestions_Select_All();
                entity.STATUS = status;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status)
        {
            try
            {
                BOVoteQuestions_Select_Top action = new BOVoteQuestions_Select_Top();
                usp_VoteQuestions_Select_Top entity = new usp_VoteQuestions_Select_Top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable Search(int vote_id)
        {
            try
            {
                BOVoteQuestions_Search action = new BOVoteQuestions_Search();
                usp_VoteQuestions_Search entity = new usp_VoteQuestions_Search();
                entity.VOTE_ID = vote_id;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status)
        {
            try
            {
                BOVoteQuestions_Select_WithPaged action = new BOVoteQuestions_Select_WithPaged();
                usp_VoteQuestions_Select_WithPaged entity = new usp_VoteQuestions_Select_WithPaged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;

                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Insert(string vote_question, string vote_question_eng, string vote_answers, string vote_answers_eng, DateTime start_vote, DateTime end_vote, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOVoteQuestions_Insert action = new BOVoteQuestions_Insert();
                usp_VoteQuestions_Insert entity = new usp_VoteQuestions_Insert();
                entity.VOTE_QUESTION = vote_question;
                entity.VOTE_QUESTION_ENG = vote_question_eng;
                entity.VOTE_ANSWERS = vote_answers;
                entity.VOTE_ANSWERS_ENG = vote_answers_eng;
                entity.START_VOTE = start_vote;
                entity.END_VOTE = end_vote;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Update(Int64 vote_id, string vote_question, string vote_question_eng, string vote_answers, string vote_answers_eng, DateTime start_vote, DateTime end_vote, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOVoteQuestions_Update action = new BOVoteQuestions_Update();
                usp_VoteQuestions_Update entity = new usp_VoteQuestions_Update();
                entity.VOTE_ID = vote_id;
                entity.VOTE_QUESTION = vote_question;
                entity.VOTE_QUESTION_ENG = vote_question_eng;
                entity.VOTE_ANSWERS = vote_answers;
                entity.VOTE_ANSWERS_ENG = vote_answers_eng;
                entity.START_VOTE = start_vote;
                entity.END_VOTE = end_vote;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Delete(int vote_id)
        {
            try
            {
                BOVoteQuestions_Delete action = new BOVoteQuestions_Delete();
                usp_VoteQuestions_Delete entity = new usp_VoteQuestions_Delete();
                entity.VOTE_ID = vote_id;

                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Restore(int vote_id)
        {
            try
            {
                BOVoteQuestions_Restore action = new BOVoteQuestions_Restore();
                usp_VoteQuestions_Restore entity = new usp_VoteQuestions_Restore();
                entity.VOTE_ID = vote_id;

                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
